package cn.baddonkey.photography.agent.core.enums;

public enum YesNoEnum {
    YES(1, "是"), NO(0, "否");

    private int code;
    private String name;

    YesNoEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getName(int code) {
        for (YesNoEnum item : YesNoEnum.values()) {
            if (item.code == code) {
                return item.name;
            }
        }
        return null;
    }
}
